<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../day48/demo/js/ajax.js"></script>
</head>
<body>
    
</body>
<script>
    function readText(url){
        var p = new Promise(function(resolve,reject){
            aaaa;
            $.ajax({
                type: "get",
                url: url,
                success: function(text){
                    resolve(text);
                }
            })
        })
        return p;
    }

    readText("../day49/1.txt").then(function(text){
        console.log("请求成功", text);
    }).catch(err => {
        console.log("执行失败",err);
    })
</script>
</html>